<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    
</body>
<script>
    var adBox = document.createElement("div");
    adBox.className = "adBox";
    document.body.appendChild(adBox);
    adBox.style.width = "300px";
    adBox.style.height = "400px";
    adBox.style.backgroundColor = "#6ff";
    adBox.style.position = "fixed";
    adBox.style.right = "5px";
    adBox.style.bottom = "5px";
    adBox.style.display = "block";
    adBox.prepend(title);
    adBox.append(main)

    var title = document.createElement("div");
    title.className = "title";
    title.prepend(tips);
    title.append(closeDiv);
    title.style.position = "relative";
    title.style.dontSize = "14px";

    var tips = document.createElement("div");
    tips.className = tips;
    tips.textContent = "距离广告关闭还有8秒";
    tips.style.textIndxt = "5px";

    var closeDiv = document.createElement("div");
    closeDiv.className = "closeDiv";
    



    // adBox.setAttribute("class", "title");
    // var title = document.getElementsByClassName("title")[0];

    // adBox.setAttribute("class", "tips");
    // var tips = document.querySelector(".tips");

    // adBox.setAttribute("class", "closeDiv");
    // var closeDiv = document.querySelector(".close");

    // adBox.setAttribute("class", "main");
    // var main = document.getElementsByClassName("main")[0];




    // adBox.style.width = "300px";
    // adBox.style.height = "400px";
    // adBox.style.backgroundColor = "#6ff";
    // adBox.style.position = "fixed";
    // adBox.style.right = "5px";
    // adBox.style.bottom = "5px";
    // adBox.style.display = "block";

    // title.style.position = "relative";
    // title.style.dontSize = "14px";

    // tips.style.textIndxt = "5px";

    // closeDiv.style.position = "absolute";
    // closeDiv.style.right = "0";
    // closeDiv.style.top = "0";
    // closeDiv.style.padding = "0 4px";
    // closeDiv.style.backgroundColor = "#f00";
    
    
    
    // closeDiv.innerHTML = "<div>" + "x" + "</div>";
    // main.innerHTML = "<a>" + `<img src="https://img20.360buyimg.com/babel/s580x740_jfs/t1/169223/11/9002/236742/603f38feEa4a8d83e/4ace79eafcac855c.jpg!cc_290x370.webp" style="width:100% " alt="">` + "</a> ";

    // tips.innerHTML = "<div>" + "距离广告关闭还有8秒" + "</div>";
    // closeDiv.innerHTML = "<div>" + "x" + "</div>";



    // adBox.innerHTML = `<div class="title">
    //                         <div class="tips">距离广告关闭还有8秒</div>
    //                         <div class="close">x</div>
    //                     </div>
    //                     <div class="body">
    //                         <a href="">
    //                             <img style="width:100% " src="https://img20.360buyimg.com/babel/s580x740_jfs/t1/169223/11/9002/236742/603f38feEa4a8d83e/4ace79eafcac855c.jpg!cc_290x370.webp" alt="">
    //                         </a>
    //                     </div>`



</script>

</html>